package reservation;
import java.sql.SQLException;
import java.util.Map;
import javax.servlet.http.HttpSession;

import com.opensymphony.xwork2.ActionContext;

public class LoginController {
	private String user;
	private String password;
	
	public String execute() {
		
		if ("User".equals(user) && "12345".equals(password))
		{
			Map session = ActionContext.getContext().getSession();
			session.put("currentUser", user);
			return "Success";
		}
		else
		{
			return "Failure";
		}
	}
	
	public String logOut(){
		Map session = ActionContext.getContext().getSession();
		session.remove("currentUser")
		return "Success";
	}
	
	public String getUser(){
		return user;
	}
	public String getPassword(){
		return password;
	}
	public void setUser(String newUser){
		user = newUser;
	}
	public void setPassword(String newPass){
		password = newPass;
	}

}
